package com.prjsystem.dao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class BaseDao extends SqlMapClientDaoSupport{

	@SuppressWarnings("unchecked")
	public List excuteQueryForList(String arg0, Object arg1){
		return getSqlMapClientTemplate().queryForList(arg0, arg1);
	}
	
	@SuppressWarnings("unchecked")
	public List excuteQueryById (String arg0, Object arg1) {
		return getSqlMapClientTemplate().queryForList(arg0, arg1);
	}
	
	public Object excuteQueryForObject(String arg0, Object arg1) {
		return getSqlMapClientTemplate().queryForObject(arg0, arg1);
	}
	
	@SuppressWarnings({ "unchecked" })
	protected List excuteQueryForstring(String string) {
		try {
			return getSqlMapClientTemplate().queryForList(string);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
	@SuppressWarnings("unchecked")
	public List excuteQueryForPage(String arg0, Object arg1, int arg2, int arg3){
		return getSqlMapClientTemplate().queryForList(arg0, arg1, arg2, arg3);
	}
	
	public Object excuteInsert(String arg0, Object arg1){
		return getSqlMapClientTemplate().insert(arg0, arg1);
	}
	
	public int excuteUpdate(String arg0, Object arg1){
		return getSqlMapClientTemplate().update(arg0, arg1);
	}
	
	public int excuteUpdate(String arg0){
		return getSqlMapClientTemplate().update(arg0);
	}
	
	public int excuteDelete(String arg0, Object arg1){
		return getSqlMapClientTemplate().delete(arg0, arg1);
	}
}
